const invoicemixin = {
	methods: {
		calcAmount(editPrice, item) {
			item && this.setMon(item)
			console.log('calAmount', this.data2[0].numskk)
			this.Amount = 0
			this.AmountOld = 0
			let count = 0
			this.data2.forEach((item) => {
				count += Number(item.numskk)
				this.handleValChange(null, item, null, editPrice || false)
			})
			this.Count = parseFloat(count).toFixed(4) || 0;
		},
		setMon(e) {
			const arr = e.numskk.split('.')
			if (arr.length > 1) {
				e.numskk = arr[0] + '.' + arr[1].slice(0, 4)
			}
			if (isNaN(e.numskk * 1)) {
				e.numskk = ''
			}
			console.log(e.numskk, 'setMon');
		},
	}
}

export { invoicemixin }